package com.ruoyi.fetv.util;


import com.ruoyi.fetv.domain.FetvInformation;

import javax.validation.constraints.NotNull;
import java.lang.reflect.Field;

/**
 * @ClassName BeanToJson
 * @Description 个人使用，方便获得Bean的字段名 与 notnull
 * @Author 肖润杰
 * @Time 2023/3/8 13:46
 * @Version 1.0
 */
@Deprecated

public class BeanToSout {
    public static void main(String[] args) {
        soutd(FetvInformation.class);
    }

    private static void soutd(Class c) {
        StringBuilder stringBuilder = new StringBuilder();
        for (Field declaredField : c.getDeclaredFields()) {
            stringBuilder.append(declaredField.getName());
            if (declaredField.getAnnotation(NotNull.class) == null) {
                stringBuilder.append("\n");
            } else {
                stringBuilder.append("  true\n");
            }
        }
        System.out.println(stringBuilder);
    }
}
